package cn.est.config;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName OssConfig
 * @Description TODO
 * @Author yaozhaobao
 * @Date 2021/4/16 8:42
 * @Version 1.0
 **/
@Configuration
@ConfigurationProperties(prefix = "oss")
@Data
public class  OssConfig {

    private String endPoint ;
    private String accesskeyid;
    private String accesskeysecret;
    private String bucketName;
    private String ossWebUrl ;

    @Bean
    public OSS getOssClient(){
        return new OSSClientBuilder().build(endPoint, accesskeyid, accesskeysecret);
    }
}
